<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>秀恩爱-管理甜蜜合影</title>
<link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/header.css">
<link rel="stylesheet" type="text/css" href="css/story_user.css">
<link href="css/footer.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.11.3.min.js" charset='utf-8'></script>

</head>
<body>
	<header>
		<script src="js/header.js"></script>
	</header>
	<script>var uls=document.getElementsByClassName("menu_more");
        for(var i=0;i<uls.length;i++){
            uls.item(i).onmouseover=function(){
                this.getElementsByTagName("ul")[0].style.display="block";
            }
            uls.item(i).onmouseout=function(){
                this.getElementsByTagName("ul")[0].style.display="none";
            }
        }
            $.post("regLogServlet?t="+new Date(),{op:"getUserLoginInfo"},function(data){
    		var str="";
    		var pic="";
    		
    		if(data==0){ //没有登录
    			str="<p><a href='register.html' class='set'>注册</a><a href='login.html' class='up'>登录</a></p>"
    			pic="<a class='upload selfProfile' href='#'><img width='80' height='100' src='images/hzh2.png'></a><div class='link'><a class='lYellow' href='#'>编辑资料</a><a class='LGray' href='#'>认证</a></div>";
    		}else{
    			str="<p><a style='color:red' href='mybaihee.jsp' class='set'>"+data.loginUserInfo[0].NICKNAME+"</a><a href='login.html' class='up'>[切换用户]</a></p>"
    			if(data.loginUserInfo[0].TOUXIANG==null){
    				pic="<a class='upload selfProfile' href='#'><img width='80' height='100' src='images/hzh2.png'></a><div class='link'><a class='lYellow' href='#'>编辑资料</a><a class='LGray' href='#'>认证</a></div>";
    			}else{
    				pic="<a class='upload selfProfile' href='#'><img width='80' height='100' src='"+data.loginUserInfo[0].TOUXIANG+"'></a><div class='link'><a class='lYellow' href='#'>编辑资料</a><a class='LGray' href='#'>认证</a></div>";
    			}
    		}
    		$(".setUp").html(str);
    		$(".pic").html(pic);
    	},"json");
        </script>

	<div id="baihe_page">
		<div id="baihe_content" class="cols_bj">
			<div id="baihe_col1">
				<div class="subNav">
					<div class="pic">
						<a class="upload selfProfile" href="#"> <img width="80"
							height="100" alt="" src="images/hzh2.png"> <span
							id="uploadPhoto" style="display: none;">上传形象照</span> </a>
						<div class="link">
							<a class="lYellow" href="#">编辑资料</a> <a class="LGray" href="#/">认证</a>
						</div>
					</div>
					<div class="menuCont skBg1">
						<div class="title">
							<a href="#">我的百合</a>
						</div>
					</div>
					<div class="menuCont skBg2">
						<div class="title">
							<a href="#">会员服务</a>
						</div>
						<ul>
							<li><a href="#"> <span>·</span> 我的订单 </a></li>
							<li><a href="#"> <span>·</span> 水晶会员 </a></li>
							<li><a href="#"> <span>·</span> 至尊会员 </a></li>
							<li><a href="#"> <span>·</span> 金至尊会员 </a></li>
							<li><a href="#" target="_blank"> <span>·</span> 红娘一对一服务
							</a></li>
							<li><a href="#"> <span>·</span> 购买红豆 </a></li>
							<li><a href="#"> <span>·</span> 焦点明星 </a></li>
							<li class="menuHYFF" style="display:none">
							<li class="menuHYFF" style="display:none">
							<li id="zhuiqiu3" class="menuHYFF" style="display:none">
							<li class="menuHYFF" style="display:none">
							<li class="menuHYFF" style="display:none">
						</ul>
						<div class="more">
							<a class="downIcon" href="#">更多</a>
						</div>
					</div>
					<div class="menuCont skBg3">
						<div class="title">
							<a href="#">百合应用</a>
						</div>
						<ul>
							<li><a href="#"> <span>·</span> 恋爱帮帮忙 <img width="22"
									height="10" alt="new" src="images/new.gif"> </a></li>
							<li><a href="#"> <span>·</span> 丘比特之箭 <img width="22"
									height="10" alt="new" src="images/new.gif"> </a></li>
							<li><a href="#"> <span>·</span> 幸运宝藏 <img width="22"
									height="10" alt="new" src="images/new.gif"> </a></li>
							<li><a href="#"> <span>·</span> 百合说说 </a></li>
							<li><a href="#"> <span>·</span> 成长俱乐部 <img width="22"
									height="10" alt="new" src="images/new.gif"> </a></li>
							<li><a href="#"> <span>·</span> 赚取红豆 </a></li>
							<li><a href="#"> <span>·</span> 相亲助手 </a></li>
							<li><a href="#"> <span>·</span> 恋爱ing </a></li>
							<li><a href="#"> <span>·</span> 花瓣抽奖 </a></li>
							<li class="menuBHYY" style="display:none">
							<li class="menuBHYY" style="display:none">
						</ul>
						<div class="more">
							<a class="downIcon" href="#">更多</a>
						</div>
					</div>
					<div class="menuCont">
						<div class="title">
							<a href="#">百合帐户</a>
						</div>
						<ul>
							<li><a href="#"> <span>·</span> 实名认证 </a></li>
							<li><a href="#"> <span>·</span> 择偶意向 </a></li>
							<li><a href="#"> <span>·</span> 帐号设置 </a></li>
							<li><a href="#"> <span>·</span> 修改密码 </a></li>
							<li><a href="#"> <span>·</span> 黑名单 </a></li>
						</ul>
					</div>
					<div class="leftAd">
						<img src="images/storyadv1.jpg" />
					</div>
				</div>
			</div>

			<div id="baihe_col6">
				<div class="list_subnav">
					<ul>
						<li><a href="uploadstory.jsp">编辑成功故事空间</a>
						</li>
						<li><a href="uploadstory2.html">上传成功故事</a>
						</li>
						<li><a href="uploadstory3.html">上传甜蜜合影</a>
						</li>
						<li class="now"><a href="#">管理甜蜜合影</a>
						</li>
					</ul>
				</div>
				<div class="list_content">
					<div class="list_pagegray"></div>
					<!--pageEnd-->

					<div class="article_pic">
						<form action="ctact.php?tp=photo" method="post" id="dFrm">
							<ul id="ul_id">

							<c:forEach var="i" begin="1" end="${minepic.size() }">
								<li id="${i }">
									<dl>
										<dd>
											<a href="#"><img src="${minepic.get(i-1) }" />
											</a> <span id="normal_${i }"> <a class="fl" href="javascript:editPicCaption('${i }')"><b>instance49</b>
											</a>&nbsp;&nbsp;&nbsp; <a class="del" href="javascript:if(confirm('是否要确认删掉此图片，删除后将无法恢复，如需要恢复请联系工作人员')){ajax_delete_photo('${i }','125441938');}">删除</a>
											</span> <span class="fail">审核中</span> <span id="input_${i }"
												style="display:none"><input id="caption_${i }"
												name="" type="text" value="instance49" />
											</span> <span id="button_${i }" style="display:none"><a class="fr name" href="javascript:updatename('${i }');">确定</a>
											</span>
										</dd>
									</dl></li>
							</c:forEach>
							</ul>
						</form>
					</div>

					<div class="list_pagegray"></div>
					<!--pageEnd-->
				</div>
			</div>
			<!--headbaihe_col6-->
			<div id="bannner_bg">
				<div class="ad">
					<a tareget="_blank" href="#"> <img src="images/storyadv2.jpg">
					</a>
				</div>
			</div>
			<!--AD-->
		</div>
		<!--headContent-->

		<script type="text/javascript" src="js/foot.js" charset='utf-8'></script>
		<!--headFooterEnd-->
	</div>

	<script language="javascript">
            function editPicCaption(id) {
                document.getElementById('normal_'+id).style.display = 'none';
                document.getElementById('input_'+id).style.display = '';
                document.getElementById('button_'+id).style.display = '';
            }
           
            //修改照片名称
            function updatename(id){
            	var caption=document.getElementById('caption_'+id).value; //新名字
            	
            	 document.getElementById('normal_'+id).style.display = ''; 
                 document.getElementById('input_'+id).style.display = 'none';  
                 document.getElementById('button_'+id).style.display = 'none';
                 
                 document.getElementById('normal_'+id).innerHTML = document.getElementById('normal_'+id).innerHTML.replace(/<b>.*<\/b>/i, caption);
            }
            
           /* function ajax_edit_caption(id,userid){
                var caption = document.getElementById('caption_'+id).value;
                $.ajax({
                    type: "POST",
                    url: "index.php?action=editTitlePhoto",
                    dataType: "json",
                    data: "id="+id+"&caption="+caption+"&userid="+userid,
                    success: function(msg){
                        document.getElementById('normal_'+id).style.display = ''; 
                        document.getElementById('input_'+id).style.display = 'none';  
                        document.getElementById('button_'+id).style.display = 'none';
                        if(msg.message=='ok'){
                            document.getElementById('normal_'+id).innerHTML = document.getElementById('normal_'+id).innerHTML.replace(/<b>.*<\/b>/i, caption);
                        }else{
                            alert(msg.message);
                        }
                    }
                });
            } */
            function ajax_delete_photo(id,userid){

                $.ajax({
                    type: "POST",
                    url: "index.php?action=deleteManagePhoto",
                    dataType: "json",
                    data: "id="+id+"&userid="+userid,
                    success: function(msg){
                        if(msg.message == 'ok'){
                            document.getElementById('li_'+id).style.display = 'none';
                        } else {
                            alert(msg.message);		 	
                        }
                    }
                });    
            }
        </script>
	<!-- Start Alexa Certify Javascript -->
	<script type="text/javascript">  _atrk_opts = { atrk_acct:"O3rui1asyr00wL", domain:"baihe.com",dynamic: true};  (function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = "https://d31qbv1cthcecs.cloudfront.net/atrk.js"; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();  </script>
	<noscript>
	</noscript>
	<!-- End Alexa Certify Javascript -->
</body>
</html>

